import Vue from 'vue'
import VueRouter from 'vue-router'
import login from '../views/login.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'login',
    component: login
  },
  {
    path: '/about',
    name: 'About',
    component: function () {
      return import('../views/About.vue')
    }
  },
  {
    path: '/home',
    name: 'home',
    component: function () {
      return import('../views/home.vue')
    },
    children: [{
        path: 'demoa',
        name: 'demoa',
        meta: {
          arr: ["首页", "用户信息展示"],
          linktext: "用户信息展示4",
          linkicon: "el-icon-delete-solid",
          linkto: "/home/demoa"
        },
        component: () => import('../views/er/demoa.vue')
      },
      {
        path: 'demob',
        name: 'demob',
        meta: {
          arr: ["首页", "大数据可视化"],
          linktext: "大数据可视化3",
          linkicon: "el-icon-delete-solid",
          linkto: "/home/demob"
        },
        component: () => import('../views/er/demob.vue')
      },
      {
        path: 'democ',
        name: 'democ',
        meta: {
          arr: ["首页", "百度map"],
          linktext: "百度map1",
          linkicon: "el-icon-s-check",
          linkto: "/home/democ"
        },
        component: () => import('../views/er/democ.vue')
      },
      {
        path: 'demod',
        name: 'demod',
        meta: {
          arr: ["首页", "图片上传2"],
          linktext: "图片上传",
          linkicon: "el-icon-picture-outline-round",
          linkto: "/home/demod"
        },
        component: () => import('../views/er/demod.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router